/**
 * @public 首页
 * @desc   首页/公告栏
 * @param  {String}
 * @return {Boolean} 
 */

/* layout */
import Layout from '../views/layout/Layout';

/* logiLayout */
const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);


/* home */
const home = resolve => require(['../views/home/index'], resolve);

// 公告栏 --- cm
const noticeList = resolve => require(['../views/home/comps/noticeList'], resolve);
const messageList = resolve => require(['../views/home/comps/messageList'], resolve);
const newsDetail = resolve => require(['../views/home/comps/newsDetail'], resolve);
const readDetails = resolve => require(['../views/home/comps/readDetails'], resolve);
const downloadDetails = resolve => require(['../views/home/comps/downloadDetails'], resolve);
const uploadFile = resolve => require(['../views/home/comps/uploadFile'], resolve);
const announce = resolve => require(['../views/home/comps/announce'], resolve);
const replaceNews = resolve => require(['../views/home/comps/replaceNews'], resolve);

export const homeRouterMap = [{
        path: '/',
        //component: Layout,
        redirect: '/home',
        name: '首页',
        hidden: true,
        //children: [{ path: 'home', component: home }]
    },
    {
        path: '/home',
        component: Layout,
        redirect: '/home/index',
        name: '公告栏',
        icon: 'zujian',
        noDropdown: true,
        meta: {
            cache: 'noticeList,messageList'
        },
        children: [
            { path: 'index', component: home },
            { path: 'noticeList', component: noticeList, name: '公告列表' },
            { path: 'messageList', component: messageList, name: '资料文档' },
            { path: 'newsDetail/:state?/:id?', component: newsDetail, name: '资讯详情' },
            { path: 'readDetails/:id?', component: readDetails, name: '阅读详情' },
            { path: 'downloadDetails/:id?', component: downloadDetails, name: '下载详情' },
            { path: 'uploadFile', component: uploadFile, name: '上传资料' },
            { path: 'announce', component: announce, name: '发布公告' },
            { path: 'replaceNews/:id?/:position?', component: replaceNews, name: '替换要闻' }
        ]
    },
    { path: '*', redirect: '/404', hidden: true }
];
export default homeRouterMap